import { Component } from 'vue-facing-decorator'
import Render from '@/render/Render'
import toNative from '@/utils/toNative'
import { Button } from 'ant-design-vue'
import TableRender, { type TableRenderColumnTypes } from '@/render/TableRender'
import type { VxeColumnSlotTypes, VxeTableDataRow } from 'vxe-table'
import DetailView from './components/detail/Index'
import { DispatchingCompanyView } from '@/views/insurance-center/dispatching-company/Index'
import { getAgentServeCompanyList } from '@/api/insurance/agent'

@Component
export class DispatchingView extends DispatchingCompanyView {
    tableColumnConfig() {
        const config = super.tableColumnConfig()
        config.splice(-2, 0, {
            field: 'source',
            title: '数据来源',
            width: 100,
        })
        return config
    }

    onLoadData(page: number, size: number, filters: { serveCompanyOrCompanyName: string }) {
        return getAgentServeCompanyList({
            pageNum: page,
            pageSize: size,
            ...filters
        })
    }
}

export default toNative<{}, {}>(DispatchingView)